<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Bundler::GemHelper - bundler: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-gemspec">::gemspec</a>
    <li ><a href="#method-c-install_tasks">::install_tasks</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-c-tag_prefix-3D">::tag_prefix=</a>
    <li ><a href="#method-i-allowed_push_host">#allowed_push_host</a>
    <li ><a href="#method-i-already_tagged-3F">#already_tagged?</a>
    <li ><a href="#method-i-build_checksum">#build_checksum</a>
    <li ><a href="#method-i-build_gem">#build_gem</a>
    <li ><a href="#method-i-built_gem_path">#built_gem_path</a>
    <li ><a href="#method-i-clean-3F">#clean?</a>
    <li ><a href="#method-i-committed-3F">#committed?</a>
    <li ><a href="#method-i-current_branch">#current_branch</a>
    <li ><a href="#method-i-default_remote">#default_remote</a>
    <li ><a href="#method-i-gem_command">#gem_command</a>
    <li ><a href="#method-i-gem_key">#gem_key</a>
    <li ><a href="#method-i-gem_push-3F">#gem_push?</a>
    <li ><a href="#method-i-gem_push_host">#gem_push_host</a>
    <li ><a href="#method-i-git_push">#git_push</a>
    <li ><a href="#method-i-guard_clean">#guard_clean</a>
    <li ><a href="#method-i-install">#install</a>
    <li ><a href="#method-i-install_gem">#install_gem</a>
    <li ><a href="#method-i-name">#name</a>
    <li ><a href="#method-i-rubygem_push">#rubygem_push</a>
    <li ><a href="#method-i-sh">#sh</a>
    <li ><a href="#method-i-sh_with_input">#sh_with_input</a>
    <li ><a href="#method-i-sh_with_status">#sh_with_status</a>
    <li ><a href="#method-i-tag_version">#tag_version</a>
    <li ><a href="#method-i-version">#version</a>
    <li ><a href="#method-i-version_tag">#version_tag</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Bundler::GemHelper">
    <h1 id="class-Bundler::GemHelper" class="class">
      class Bundler::GemHelper
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">



        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-c-instance" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">instance</span><span
                class="attribute-access-type">[RW]</span>
            </div>

            <div class="method-description">
              <p>set when install’d.</p>
              </div>
            </div>
          <div id="attribute-i-base" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">base</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-gemspec" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">gemspec</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-spec_path" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">spec_path</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-tag_prefix" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">tag_prefix</span><span
                class="attribute-access-type">[W]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-gemspec" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gemspec</span><span
                                class="method-args">(&amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gemspec-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 22</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gemspec</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">gemspec</span> = <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">gemspec</span>
  <span class="ruby-identifier">block</span>&amp;.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">gemspec</span>)
  <span class="ruby-identifier">gemspec</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-install_tasks" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_tasks</span><span
                                class="method-args">(opts = {})</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_tasks-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 14</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_tasks</span>(<span class="ruby-identifier">opts</span> = {})
  <span class="ruby-identifier">new</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-value">:dir</span>], <span class="ruby-identifier">opts</span>[<span class="ruby-value">:name</span>]).<span class="ruby-identifier">install</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(base = nil, name = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 33</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">base</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@base</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">base</span> <span class="ruby-operator">||</span> <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">pwd</span>)
  <span class="ruby-identifier">gemspecs</span> = <span class="ruby-identifier">name</span> <span class="ruby-operator">?</span> [<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@base</span>, <span class="ruby-node">&quot;#{name}.gemspec&quot;</span>)] <span class="ruby-operator">:</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">glob_files_in_dir</span>(<span class="ruby-string">&quot;{,*}.gemspec&quot;</span>, <span class="ruby-ivar">@base</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;Unable to determine name from existing gemspec. Use :name =&gt; &#39;gemname&#39; in #install_tasks to manually set it.&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">gemspecs</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
  <span class="ruby-ivar">@spec_path</span> = <span class="ruby-identifier">gemspecs</span>.<span class="ruby-identifier">first</span>
  <span class="ruby-ivar">@gemspec</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">load_gemspec</span>(<span class="ruby-ivar">@spec_path</span>)
  <span class="ruby-ivar">@tag_prefix</span> = <span class="ruby-string">&quot;&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-tag_prefix-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tag_prefix=</span><span
                                class="method-args">(prefix)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="tag_prefix-3D-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 18</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tag_prefix=</span>(<span class="ruby-identifier">prefix</span>)
  <span class="ruby-identifier">instance</span>.<span class="ruby-identifier">tag_prefix</span> = <span class="ruby-identifier">prefix</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-build_checksum" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">build_checksum</span><span
                                class="method-args">(built_gem_path = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="build_checksum-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 105</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">build_checksum</span>(<span class="ruby-identifier">built_gem_path</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">built_gem_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">build_gem</span>
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">base</span>, <span class="ruby-string">&quot;checksums&quot;</span>)) {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">p</span>) }
  <span class="ruby-identifier">file_name</span> = <span class="ruby-node">&quot;#{File.basename(built_gem_path)}.sha512&quot;</span>
  <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;digest/sha2&quot;</span>
  <span class="ruby-identifier">checksum</span> = <span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA512</span>.<span class="ruby-identifier">file</span>(<span class="ruby-identifier">built_gem_path</span>).<span class="ruby-identifier">hexdigest</span>
  <span class="ruby-identifier">target</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">base</span>, <span class="ruby-string">&quot;checksums&quot;</span>, <span class="ruby-identifier">file_name</span>)
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">write</span>(<span class="ruby-identifier">target</span>, <span class="ruby-identifier">checksum</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;\n&quot;</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-node">&quot;#{name} #{version} checksum written to checksums/#{file_name}.&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-build_gem" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">build_gem</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="build_gem-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 86</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">build_gem</span>
  <span class="ruby-identifier">file_name</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">sh</span>([<span class="ruby-operator">*</span><span class="ruby-identifier">gem_command</span>, <span class="ruby-string">&quot;build&quot;</span>, <span class="ruby-string">&quot;-V&quot;</span>, <span class="ruby-identifier">spec_path</span>]) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">file_name</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">built_gem_path</span>)
    <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">filesystem_access</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">base</span>, <span class="ruby-string">&quot;pkg&quot;</span>)) {<span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">p</span>) }
    <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mv</span>(<span class="ruby-identifier">built_gem_path</span>, <span class="ruby-string">&quot;pkg&quot;</span>)
    <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-node">&quot;#{name} #{version} built to pkg/#{file_name}.&quot;</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">base</span>, <span class="ruby-string">&quot;pkg&quot;</span>, <span class="ruby-identifier">file_name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 42</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install</span>
  <span class="ruby-identifier">built_gem_path</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-identifier">desc</span> <span class="ruby-node">&quot;Build #{name}-#{version}.gem into the pkg directory.&quot;</span>
  <span class="ruby-identifier">task</span> <span class="ruby-string">&quot;build&quot;</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">built_gem_path</span> = <span class="ruby-identifier">build_gem</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">desc</span> <span class="ruby-node">&quot;Generate SHA512 checksum if #{name}-#{version}.gem into the checksums directory.&quot;</span>
  <span class="ruby-identifier">task</span> <span class="ruby-string">&quot;build:checksum&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;build&quot;</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">build_checksum</span>(<span class="ruby-identifier">built_gem_path</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">desc</span> <span class="ruby-node">&quot;Build and install #{name}-#{version}.gem into system gems.&quot;</span>
  <span class="ruby-identifier">task</span> <span class="ruby-string">&quot;install&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;build&quot;</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">install_gem</span>(<span class="ruby-identifier">built_gem_path</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">desc</span> <span class="ruby-node">&quot;Build and install #{name}-#{version}.gem into system gems without network access.&quot;</span>
  <span class="ruby-identifier">task</span> <span class="ruby-string">&quot;install:local&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;build&quot;</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">install_gem</span>(<span class="ruby-identifier">built_gem_path</span>, <span class="ruby-value">:local</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">desc</span> <span class="ruby-node">&quot;Create tag #{version_tag} and build and push #{name}-#{version}.gem to #{gem_push_host}\n&quot;</span> \
       <span class="ruby-string">&quot;To prevent publishing in RubyGems use `gem_push=no rake release`&quot;</span>
  <span class="ruby-identifier">task</span> <span class="ruby-string">&quot;release&quot;</span>, [<span class="ruby-value">:remote</span>] <span class="ruby-operator">=&gt;</span> [<span class="ruby-string">&quot;build&quot;</span>, <span class="ruby-string">&quot;release:guard_clean&quot;</span>,
                                <span class="ruby-string">&quot;release:source_control_push&quot;</span>, <span class="ruby-string">&quot;release:rubygem_push&quot;</span>] <span class="ruby-keyword">do</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">task</span> <span class="ruby-string">&quot;release:guard_clean&quot;</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">guard_clean</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">task</span> <span class="ruby-string">&quot;release:source_control_push&quot;</span>, [<span class="ruby-value">:remote</span>] <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_</span>, <span class="ruby-identifier">args</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">tag_version</span> { <span class="ruby-identifier">git_push</span>(<span class="ruby-identifier">args</span>[<span class="ruby-value">:remote</span>]) } <span class="ruby-keyword">unless</span> <span class="ruby-identifier">already_tagged?</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">task</span> <span class="ruby-string">&quot;release:rubygem_push&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;build&quot;</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">rubygem_push</span>(<span class="ruby-identifier">built_gem_path</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">gem_push?</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-constant">GemHelper</span>.<span class="ruby-identifier">instance</span> = <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-install_gem" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">install_gem</span><span
                                class="method-args">(built_gem_path = nil, local = false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="install_gem-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 97</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_gem</span>(<span class="ruby-identifier">built_gem_path</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">local</span> = <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">built_gem_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">build_gem</span>
  <span class="ruby-identifier">cmd</span> = [<span class="ruby-operator">*</span><span class="ruby-identifier">gem_command</span>, <span class="ruby-string">&quot;install&quot;</span>, <span class="ruby-identifier">built_gem_path</span>.<span class="ruby-identifier">to_s</span>]
  <span class="ruby-identifier">cmd</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;--local&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">local</span>
  <span class="ruby-identifier">sh</span>(<span class="ruby-identifier">cmd</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-node">&quot;#{name} (#{version}) installed.&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="protected-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Protected Instance Methods</h3>
                </header>

                  <div id="method-i-allowed_push_host" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">allowed_push_host</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="allowed_push_host-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 149</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">allowed_push_host</span>
  <span class="ruby-ivar">@gemspec</span>.<span class="ruby-identifier">metadata</span>[<span class="ruby-string">&quot;allowed_push_host&quot;</span>] <span class="ruby-keyword">if</span> <span class="ruby-ivar">@gemspec</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:metadata</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-already_tagged-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">already_tagged?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="already_tagged-3F-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 160</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">already_tagged?</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">sh</span>(<span class="ruby-node">%w[git tag]</span>).<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\n/</span>).<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">version_tag</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-node">&quot;Tag #{version_tag} has already been created.&quot;</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-built_gem_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">built_gem_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="built_gem_path-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 126</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">built_gem_path</span>
  <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">glob_files_in_dir</span>(<span class="ruby-node">&quot;#{name}-*.gem&quot;</span>, <span class="ruby-identifier">base</span>).<span class="ruby-identifier">sort_by</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">mtime</span>(<span class="ruby-identifier">f</span>) }.<span class="ruby-identifier">last</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clean-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clean?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clean-3F-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 170</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clean?</span>
  <span class="ruby-identifier">sh_with_status</span>(<span class="ruby-node">%w[git diff --exit-code]</span>)[<span class="ruby-value">1</span>].<span class="ruby-identifier">success?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-committed-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">committed?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="committed-3F-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 174</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">committed?</span>
  <span class="ruby-identifier">sh_with_status</span>(<span class="ruby-node">%w[git diff-index --quiet --cached HEAD]</span>)[<span class="ruby-value">1</span>].<span class="ruby-identifier">success?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-current_branch" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">current_branch</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="current_branch-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 144</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">current_branch</span>
  <span class="ruby-comment"># We can replace this with `git branch --show-current` once we drop support for git &lt; 2.22.0</span>
  <span class="ruby-identifier">sh</span>(<span class="ruby-node">%w[git rev-parse --abbrev-ref HEAD]</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">%r{\Aheads/}</span>, <span class="ruby-string">&quot;&quot;</span>).<span class="ruby-identifier">strip</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-default_remote" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_remote</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_remote-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 137</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_remote</span>
  <span class="ruby-identifier">remote_for_branch</span>, <span class="ruby-identifier">status</span> = <span class="ruby-identifier">sh_with_status</span>(<span class="ruby-node">%W[git config --get branch.#{current_branch}.remote]</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-string">&quot;origin&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">success?</span>

  <span class="ruby-identifier">remote_for_branch</span>.<span class="ruby-identifier">strip</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gem_command" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gem_command</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gem_command-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 233</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gem_command</span>
  <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;GEM_COMMAND&quot;</span>]&amp;.<span class="ruby-identifier">shellsplit</span> <span class="ruby-operator">||</span> [<span class="ruby-string">&quot;gem&quot;</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gem_key" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gem_key</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gem_key-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 225</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gem_key</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-string">&quot;gem.push_key&quot;</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-string">&quot;gem.push_key&quot;</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gem_push-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gem_push?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gem_push-3F-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 229</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gem_push?</span>
  <span class="ruby-operator">!</span><span class="ruby-node">%w[n no nil false off 0]</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;gem_push&quot;</span>].<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gem_push_host" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gem_push_host</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gem_push_host-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 153</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gem_push_host</span>
  <span class="ruby-identifier">env_rubygems_host</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;RUBYGEMS_HOST&quot;</span>]
  <span class="ruby-identifier">env_rubygems_host</span> = <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">env_rubygems_host</span>&amp;.<span class="ruby-identifier">empty?</span>

  <span class="ruby-identifier">allowed_push_host</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">env_rubygems_host</span> <span class="ruby-operator">||</span> <span class="ruby-string">&quot;rubygems.org&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-git_push" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">git_push</span><span
                                class="method-args">(remote = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="git_push-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 130</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">git_push</span>(<span class="ruby-identifier">remote</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">remote</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">default_remote</span>
  <span class="ruby-identifier">sh</span>(<span class="ruby-node">&quot;git push #{remote} refs/heads/#{current_branch}&quot;</span>.<span class="ruby-identifier">shellsplit</span>)
  <span class="ruby-identifier">sh</span>(<span class="ruby-node">&quot;git push #{remote} refs/tags/#{version_tag}&quot;</span>.<span class="ruby-identifier">shellsplit</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-string">&quot;Pushed git commits and release tag.&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-guard_clean" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">guard_clean</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="guard_clean-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 166</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">guard_clean</span>
  <span class="ruby-identifier">clean?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">committed?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">raise</span>(<span class="ruby-string">&quot;There are files that need to be committed first.&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-name" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">name</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="name-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 196</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">name</span>
  <span class="ruby-identifier">gemspec</span>.<span class="ruby-identifier">name</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-rubygem_push" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rubygem_push</span><span
                                class="method-args">(path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rubygem_push-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 118</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rubygem_push</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">cmd</span> = [<span class="ruby-operator">*</span><span class="ruby-identifier">gem_command</span>, <span class="ruby-string">&quot;push&quot;</span>, <span class="ruby-identifier">path</span>]
  <span class="ruby-identifier">cmd</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;--key&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">gem_key</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">gem_key</span>
  <span class="ruby-identifier">cmd</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;--host&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">allowed_push_host</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">allowed_push_host</span>
  <span class="ruby-identifier">sh_with_input</span>(<span class="ruby-identifier">cmd</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-node">&quot;Pushed #{name} #{version} to #{gem_push_host}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-sh" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">sh</span><span
                                class="method-args">(cmd, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="sh-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 207</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sh</span>(<span class="ruby-identifier">cmd</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">out</span>, <span class="ruby-identifier">status</span> = <span class="ruby-identifier">sh_with_status</span>(<span class="ruby-identifier">cmd</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">success?</span>
    <span class="ruby-identifier">raise</span>(<span class="ruby-node">&quot;Running `#{cmd.shelljoin}` failed with the following output:\n\n#{out}\n&quot;</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">out</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-sh_with_input" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">sh_with_input</span><span
                                class="method-args">(cmd)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="sh_with_input-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 200</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sh_with_input</span>(<span class="ruby-identifier">cmd</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-identifier">cmd</span>)
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">base</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">abort</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">system</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">cmd</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-sh_with_status" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">sh_with_status</span><span
                                class="method-args">(cmd, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="sh_with_status-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 215</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">sh_with_status</span>(<span class="ruby-identifier">cmd</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-identifier">cmd</span>)
  <span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">chdir</span>(<span class="ruby-identifier">base</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">outbuf</span> = <span class="ruby-constant">IO</span>.<span class="ruby-identifier">popen</span>(<span class="ruby-identifier">cmd</span>, <span class="ruby-value">:err</span> <span class="ruby-operator">=&gt;</span> [<span class="ruby-value">:child</span>, <span class="ruby-value">:out</span>], <span class="ruby-operator">&amp;</span><span class="ruby-value">:read</span>)
    <span class="ruby-identifier">status</span> = <span class="ruby-identifier">$?</span>
    <span class="ruby-identifier">block</span>&amp;.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">outbuf</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">status</span>.<span class="ruby-identifier">success?</span>
    [<span class="ruby-identifier">outbuf</span>, <span class="ruby-identifier">status</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tag_version" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">tag_version</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="tag_version-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 178</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tag_version</span>
  <span class="ruby-identifier">sh</span> <span class="ruby-node">%W[git tag -m Version\ #{version} #{version_tag}]</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">confirm</span> <span class="ruby-node">&quot;Tagged #{version_tag}.&quot;</span>
  <span class="ruby-keyword">yield</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">RuntimeError</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">error</span> <span class="ruby-node">&quot;Untagging #{version_tag} due to error.&quot;</span>
  <span class="ruby-identifier">sh_with_status</span> <span class="ruby-node">%W[git tag -d #{version_tag}]</span>
  <span class="ruby-identifier">raise</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-version" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">version</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="version-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 188</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">version</span>
  <span class="ruby-identifier">gemspec</span>.<span class="ruby-identifier">version</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-version_tag" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">version_tag</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="version_tag-source">
            <pre><span class="ruby-comment"># File bundler/gem_helper.rb, line 192</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">version_tag</span>
  <span class="ruby-node">&quot;#{@tag_prefix}v#{version}&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

